<template>
  <div>
    <!-- 底部部分 -->
    <footer class="footer">
      <span class="todo-count"
        ><strong>{{ sy }}</strong
        >剩余</span
      >
      <ul class="filters" v-for="item in list" :key="item.id">
        <li>
          <a :class="{selected:type==='all'}" href="#/all"  @click="fn1('all')">全部</a>
        </li>
        <li>
          <a  :class="{selected:type==='active'}" href="#/active" @click="fn1('active')">进行中</a>
        </li>
        <li>
          <a  :class="{selected:type==='completed'}" href="#/completed" @click="fn1('completed')">已完成</a>
        </li>
      </ul>
      <button class="clear-completed" @click="clearQ">清除已完成</button>
    </footer>
  </div>
</template>

<script>
export default {
  name: 'AFooter',
  props: {
    list: {
      type: Array,
      require: true
    },
    type: {
      type: String,
      require: true
    }
  },
  components: {},
  data () {
    return {
      sy: 0
    }
  },
  methods: {
    clearQ () {
      this.$emit('clearQ')
    },
    fn1(value){
      this.$emit('fn1',value)
    }
  },
  mounted () {},
  watch: {},
  computed: {},
  filters: {}
}
</script>

<style scoped lang="less"></style>
